#pragma once

#include "twin.h"
#include "cfg.h"

class TSubClass : public TWin {
protected:
	WNDPROC		oldProc;

public:
	TSubClass(TWin *_parent = NULL);

	virtual BOOL	CreateByWnd(HWND _hWnd);
	virtual	LRESULT	DefWindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam);
};

class TSubClassCtl : public TSubClass {
protected:
public:
	TSubClassCtl(TWin *_parent);

	virtual	BOOL	PreProcMsg(MSG *msg);
};




class TEditSub : public TSubClassCtl {
protected:
	Cfg			*cfg;

public:
	TEditSub(Cfg *_cfg, TWin *_parent);

	virtual BOOL	EventButton(UINT uMsg, int nHitTest, POINTS pos);
	virtual BOOL	EventUser(UINT uMsg, WPARAM wParam, LPARAM lParam);
};

class TSeparateSub : public TSubClassCtl {
protected:
	HCURSOR	hCursor;

public:
	TSeparateSub(TWin *_parent);

	virtual BOOL	EvSetCursor(HWND cursorWnd, WORD nHitTest, WORD wMouseMsg);
	virtual BOOL	EvNcHitTest(POINTS pos, LRESULT *result);
	virtual BOOL	EventButton(UINT uMsg, int nHitTest, POINTS pos);
};
